#include <iostream>
#include <algorithm>
class Solution
{
	public:
		int removeElement(int A[], int n, int elem){
		int i = 0;
		int j = 0;
		for (i = 0; i < n; i++ ) {
			if(A[i] == elem){
				continue;
			}
			A[j] = A[i];
			j++;
		}
		return j;
	}
};

void main(int argc,char argc[])
{
	int array_test[] = {1,2,2,3,2,4};
	std::cout << "the array is:"
	for (int i = 0; i < 6; i++ )
	{
		std::cout << array_test[i] << " ";
	}

	std::out << " " << std::endl;
	int len = removeElement(array_test[], 6, 2);
	std::out << "after remove value, the length of array now is:" + len << std::endl;   

}

